package com.aj.http.request;

import java.util.HashMap;

import android.content.Context;
import android.util.Log;

import com.aj.http.AsynchronizationHttpRequest;
import com.aj.http.AsynchronizationHttpRequest.IHttpCallBack;

public class CMTRequest extends BaseRequset {
	private static final String TAG = FamilyZoneRequest.class.getName();

	public void excute(Context context, String userId, String cmtType,
			String cmtId, String oper, String cmtContent, String cmtTarget,
			String replyCmtId, String cmtUserName, String cmtUserTel,
			IHttpCallBack httpCallBack) {
		HashMap<String, String> paramsHashMap = new HashMap<String, String>();
		paramsHashMap.put("userId", userId);
		// 1：添加 2：修改 3：删除
		paramsHashMap.put("oper", oper);
		// 1空间评论
		paramsHashMap.put("cmtType", cmtType);
		if (cmtId != null) {
			paramsHashMap.put("cmtId", cmtId);
		}
		if (cmtContent != null) {
			paramsHashMap.put("cmtContent", cmtContent);
		}
		if (cmtTarget != null) {
			paramsHashMap.put("cmtTarget", cmtTarget);
		}
		if (replyCmtId != null) {
			paramsHashMap.put("replyCmtId", replyCmtId);
		}
		if (cmtUserName != null) {
			paramsHashMap.put("cmtUserName", cmtUserName);
		}
		if (cmtUserTel != null) {
			paramsHashMap.put("cmtUserTel", cmtUserTel);
		}

		String tempString = getParams(SERVICE_CMT_MGR_STRING, paramsHashMap);
		Log.e(TAG, "tempString:" + tempString);
		// TODO加密
		AsynchronizationHttpRequest request = new AsynchronizationHttpRequest();
		request.excute(context, BASE_REQUEST_URL_NOPAGE_STRING, tempString,
				httpCallBack);
	}
}
